import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import pinia from './store/index.js'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
// 覆盖原来的ui框架css
// import './assets/styles/element-variables.scss'
// 如果需要自定义全局样式，在index.scss里面添加或者修改即可
import './assets/styles/index.scss'
// 引入阿里图标
import './assets/iconfont/iconfont.css'
// 全局自定义指令
import { auth } from './directive/index'
// 路由拦截器
import './router/permission.js'

const app = createApp(App)
// 注册全局自定义指令
app.directive('auth', auth)
// 注册Element图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
app.use(pinia)
app.use(router)
app.use(ElementPlus)
app.mount('#app')
